<template>
	<view class="pb">
		<uni-list >
			<uni-list-chat :title="info.full_name" :avatar="info.log" :note="info.scale"></uni-list-chat>
		</uni-list>
		<uni-section title="公司简介" type="line" padding>
			<view v-html="info.introduce"></view>
			<uni-grid :column="3" :show-border="false" :square="false" :highlight="true" @change="change">
				<uni-grid-item v-for="(item, index) in info.image" :index="index" :key="index">
					<view class="p4" style="background-color: #fff;">
						<image style="width: 100%;height: 300rpx;" mode="aspectFill" :src="item"></image>
					</view>
				</uni-grid-item>
			</uni-grid>
		</uni-section>
		<view class="line_ccc"></view>
		<uni-section title="工商信息" type="line" padding>
			<view>企业名称:{{info.full_name}}</view>
			<view v-if="info.legal_person">法定代表人:{{info.legal_person}}</view>
			<view v-if="info.registered_capital">注册资本:{{info.registered_capital}}</view>
			<view v-if="info.registered_date">成立日期:{{info.registered_date}}</view>
			<view v-if="info.licence">经营范围:{{info.licence}}</view>
		</uni-section>
		<view class="line_ccc"></view>
		<uni-section title="公司地址" type="line" padding>
			{{info.province}}{{info.city}}{{info.areas}}{{info.address}}
		</uni-section>
		<view class="line_ccc"></view>
		<view class="fixed-bottom" v-show="!show">
			<view class="p0-8"><button class="default-button-push" @click="onLink('/pages/cpmpany/cpmpany_recruit',id)">在招职位 ({{info.company_jobs_count}})</button></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:0,
				info:{full_name:'企业名称',introduce:'公司简介',province:'省市',city:'城市',areas:'地区',address:'地址',company_jobs_count:0},
				
				shareinfo:{title:'',img:'',path:''}
			}
		},
		onLoad(options){
			this.id = options.id
			this.onGetInfo()
			// wages: 0
		},
		methods: {
			onGetInfo(){
				let _this = this
				this.$request_api('applet_api/company/info/'+_this.id,'GET').then(res => {
					_this.info = res.data
					_this.info.scale = _this.$func.scale[_this.info.scale]
					_this.info.image = JSON.parse(_this.info.images)
					
					_this.shareinfo.title = _this.info.full_name
					_this.shareinfo.img = _this.info.log
				}).catch(err => {
					console.log(err)
				})
			},
			change(e){
				wx.previewImage({
					current: this.info.image[e.detail.index], // 当前显示图片的http链接
					urls: this.info.image
				})
			},
			onLink(url,id){
				this.$func.onLink(url,id)
			},
		}
	}
</script>

<style>

</style>
